1. Field of the Invention
The present invention relates generally to a stereo camera system and method for adjusting the deviation of an optical axis of a stereo camera.
2. Related Background Art
As a three-dimensional measuring technique based on images, there is known an image processing based on a so-called stereo method for deriving a correlation between a pair of images, which are obtained by picking up an object from different positions by two cameras (a stereo camera), to derive a distance by a parallax for the same object on the basis of the principle of triangulation using camera parameters, such as the mounting position and focal length of the stereo camera.
In this image processing based on the stereo method, two picture signals obtained by the stereo camera are sequentially shifted to be superposed on each other to derive a position at which the two picture signals are coincident with each other. Therefore, it is desired that there are no deviations other than the parallax between the two picture signals, so that the optical positioning of the stereo camera is important.
Thus, Japanese Patent Laid-Open No. 5-157557 discloses that a holding member for connecting and holding a pair of video cameras has parallelism adjusting means for adjusting the arrangement of pixels of an image sensor of one of the video cameras so as to be parallel to the arrangement of pixels of an image sensor of the other video camera, and an optical axis adjusting member for adjusting the optical axis of one of the video cameras so as to be parallel to the optical axis of the other video camera, so that the correlation between the two cameras is mechanically adjusted and held.
However, even if the stereo camera is fixed once, the deviation of the stereo camera is easily caused with secular change. Conventionally, if such a deviation is caused, the stereo camera must be mechanically readjusted. Therefore, it is not only required to carry out the complicated operation, but it also takes a lot of time to readjust the stereo camera, so that there is a limit to the mechanical adjustment to ensure required accuracy.
In order to cope with this problem, Japanese Patent Application No. 9-117268, which is assigned to the present Assignee and incorporated herein by reference, discloses a technique for electrically adjusting the optical position of a stereo camera without the need of any mechanical adjustments. This technique can accurately adjust the optical position of a stereo camera to a level, at which it is difficult to mechanically adjust the optical position of the stereo camera, and easily readjust the deviation due to secular change after the adjustment.
However, since the technique disclosed in Japanese Patent Application No. 9-117268 is designed to pick up an image of a special adjusting pattern by means of a stereo camera to correct the optical position of the stereo camera, it is required to periodically stop the operation of the stereo camera in an image processing field to adjust the optical position of the stereo camera, so that it is required to care maintenance.
It is therefore an object of the present invention to eliminate the aforementioned problems and to provide a stereo camera adjusting system and method capable of automatically adjusting the age-based deviation of the optical axis of a stereo camera while maintaining the operating state thereof from an early stage, in which it is possible to disregard the influence on ranging accuracy.
In order to accomplish the aforementioned and other objects, according to one aspect of the present invention, there is provided a stereo camera adjusting system for adjusting an optical axis of a stereo camera having first and second cameras arranged at regular intervals, the system comprising: image adjusting means for geometrically transforming an image, which is picked up by the second camera, by a translation correction and a rotation correction, and for geometrically transforming an image, which is picked up by the first camera, by a rotation correction; and correction operating means for calculating a difference between corresponding positions of the images, which are picked up by the first and second cameras, on the basis of distance data obtained by stereo-processing the pair of images picked up by the first and second cameras, and for setting a transforming value for the image transformation so as to remove the difference.
The correction operating means may calculate the difference on the basis of two distant regions substantially at the same distance and one near region. The correction operating means may define a range including regions corresponding to the regions, in the image picked up by the second camera, on the basis of distance data of the distant regions of the image picked up by the first camera, and search the defined range to derive the distant regions of the image picked up by the second camera. The image adjusting means may geometrically transform the image, which is picked up by the second camera, by a horizontal translation correction and a vertical translation correction, and the correction operating means may calculate a transforming value for the image transformation based on the horizontal translation correction for the image picked up by the second camera, on the basis of a deviation between the positions of the regions of the images picked up by the first and second cameras, and distances of the regions. The correction operating means may set the transforming value for the image transformation on the basis of a pair of images of a landscape picked up by the first and second cameras.
According to another aspect of the present invention, there is provided a stereo camera adjusting method for adjusting an optical axis of a stereo camera having first and second cameras provided at regular intervals, the method comprising the steps of: calculating a difference between corresponding positions of images picked up by the first and second cameras, on the basis of distance data obtained by stereo-processing the pair of images picked up by the first and second cameras; setting a translation correction value and a rotation correction value for the second camera so as to remove the calculated difference; and geometrically transforming the image picked up by the second camera, by a translation correction and a rotation correction, on the basis of the set translation correction value and the set rotation correction value for the second camera.
The stereo camera adjusting method may further comprise the steps of: setting a rotation correction value for the first camera so as to remove the calculated difference; and geometrically transforming the image picked up by the first camera, by a rotation correction on the basis of the set rotation correction value for the first camera.
That is, according to the present invention, on the basis of distance data obtained by processing a pair of images of a landscape picked up by a stereo camera, a difference between corresponding positions of images picked up by first and second cameras is calculated. Then, an image transforming value for a rotation correction in the image picked up by the first camera, and image transforming values for a translation correction and a rotation correction in horizontal and vertical directions in the image picked up by the second camera are set so as to remove the difference. Then, the images picked up by the first and second cameras are geometrically transformed to automatically correct the age-based deviation of the optical axis of the stereo camera.
Thus, since the age-based deviation of the optical axis of the stereo camera is automatically adjusted while maintaining the operating state thereof from an early stage, in which it is possible to disregard the influence on ranging accuracy, it is possible to always use the stereo camera in an accurately adjusted state, and it is not required to stop the operation of the stereo camera in a field unlike the technique for picking up an image of a special adjusting pattern to adjust the optical position of the stereo camera, so that there are excellent advantages in that it is possible to achieve maintenance free.
The difference between the corresponding positions is preferably calculated on the basis of two distant regions, which are arranged substantially at the same distance, and one near region. Thus, it is possible to simultaneously carry out corrections for relative positions of the respective images and a correction for causing the horizontal line of the first camera to be parallel to the base line of the stereo camera.
In addition, the positions of the distant regions of the image picked up by the second camera may be obtained by adding distance data to the positions of the distant regions of the image picked up by the first camera, defining a range including corresponding regions, in the image picked up by the second camera, and searching the defined range. The horizontal translation correction for the image picked up by the second camera may be calculated on the basis of the deviations of the positions of the respective regions in the images picked up by the first and second cameras, and the distances of the respective regions.